
// GallopView.h : interface of the CGallopView class
//

#ifndef LUA_QT_QCOLOR_H
#define LUA_QT_QCOLOR_H

	#include <luaQt/config.h>
	#include <QList>
	#include <QAction>
	#include <QIcon>
	#include <QColor>
	

	/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//tolua_begin

	class QColor
	{
    	QColor();
    	enum Spec { Invalid, Rgb, Hsv, Cmyk, Hsl };
    	enum NameFormat { HexRgb, HexArgb };
    	QColor(Qt::GlobalColor color);
        QColor(int r, int g, int b, int a = 255);
    	QColor(QRgb rgb);
    	QColor(QRgba64 rgba64);
     	QColor(const QString& name);
     	QColor(const char *aname);
    	QColor(QLatin1String name);
    	QColor(Spec spec);
    	bool isValid() const;

		// ### Qt 6: merge overloads
		QString name() const;
    	QString name(NameFormat format) const;

    	void setNamedColor(const QString& name);
    	void setNamedColor(QLatin1String name);

     	 QStringList colorNames();


    	int alpha() const;
    	void setAlpha(int alpha);

    	double alphaF() const;
    	void setAlphaF(double alpha);

    	int red() const;
    	int green() const;
    	int blue() const;
    	void setRed(int red);
    	void setGreen(int green);
    	void setBlue(int blue);

    	double redF() const;
    	double greenF() const;
    	double blueF() const;
    	void setRedF(double red);
    	void setGreenF(double green);
    	void setBlueF(double blue);

    	void getRgb(int *r, int *g, int *b, int *a) const;
    	void setRgb(int r, int g, int b, int a = 255);

    	void getRgbF(double *r, double *g, double *b, double *a);
    	void setRgbF(double r, double g, double b, double a = 1.0);

    	QRgba64 rgba64() const;
    	void setRgba64(QRgba64 rgba);

    	QRgb rgba() const ;
    	void setRgba(QRgb rgba);

    	QRgb rgb() const;
    	void setRgb(QRgb rgb);

    	int hue() const ; // 0 <= hue < 360
    	int saturation() const;
    	int hsvHue() const; // 0 <= hue < 360
    	int hsvSaturation() const;
    	int value() const ;

    	double hueF() const; // 0.0 <= hueF < 360.0
    	double saturationF() const;
    	double hsvHueF() const; // 0.0 <= hueF < 360.0
    	double hsvSaturationF() const;
    	double valueF() const;

    	void getHsv(int *h, int *s, int *v, int *a) const;
    	void setHsv(int h, int s, int v, int a = 255);

    	void getHsvF(double *h, double *s, double *v, double *a ) const;
    	void setHsvF(double h, double s, double v, double a = 1.0);

    	int cyan() const;
    	int magenta() const;
    	int yellow() const;
    	int black() const;

    	double cyanF() const;
    	double magentaF() const;
    	double yellowF() const ;
    	double blackF() const;

    	void getCmyk(int *c, int *m, int *y, int *k, int *a);
    	void setCmyk(int c, int m, int y, int k, int a = 255);

    	void getCmykF(double *c, double *m, double *y, double *k, double *a);
    	void setCmykF(double c, double m, double y, double k, double a = 1.0);

    	int hslHue() const ; // 0 <= hue < 360
    	int hslSaturation() const ;
    	int lightness() const;

    	double hslHueF() const; // 0.0 <= hueF < 360.0
    	double hslSaturationF() const ;
    	double lightnessF() const ;

    	void getHsl(int *h, int *s, int *l, int *a ) const;
    	void setHsl(int h, int s, int l, int a = 255);

    	void getHslF(double *h, double *s, double *l, double *a) const;
    	void setHslF(double h, double s, double l, double a = 1.0);

    QColor toRgb() const ;
    QColor toHsv() const ;
    QColor toCmyk() const ;
    QColor toHsl() const ;

    QColor convertTo(Spec colorSpec) const ;

    static QColor fromRgb(QRgb rgb) ;
    static QColor fromRgba(QRgb rgba) ;

    static QColor fromRgb(int r, int g, int b, int a = 255);
    static QColor fromRgbF(double r, double g, double b, double a = 1.0);

    static QColor fromRgba64(unsigned short r, unsigned short g, unsigned short b, unsigned short a = USHRT_MAX) ;
    static QColor fromRgba64(QRgba64 rgba) ;

    static QColor fromHsv(int h, int s, int v, int a = 255);
    static QColor fromHsvF(double h, double s, double v, double a = 1.0);

    static QColor fromCmyk(int c, int m, int y, int k, int a = 255);
    static QColor fromCmykF(double c, double m, double y, double k, double a = 1.0);

    static QColor fromHsl(int h, int s, int l, int a = 255);
    static QColor fromHslF(double h, double s, double l, double a = 1.0);

    QColor light(int f = 150) const ;
    QColor lighter(int f = 150) const ;
    QColor dark(int f = 200) const ;
    QColor darker(int f = 200) const ;


    operator QVariant() const;

    static bool isValidColor(const QString &name);
    static bool isValidColor(QLatin1String) ;


    
	};

	//tolua_end
	//*//////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

    

#endif
